Skip to content

Use precise type for x in case x @ (_: A, _: B), take 2#26161

Open
SolalPirelli wants to merge 2 commits into
scala:mainfrom
dotty-staging:solal/widen-problem-alt
Open

Use precise type for x in case x @ (_: A, _: B), take 2#26161
SolalPirelli wants to merge 2 commits into
scala:mainfrom
dotty-staging:solal/widen-problem-alt

Conversation

@SolalPirelli
Copy link
Copy Markdown
Contributor

Fixes #25544

Alternate for #25734

How much have you relied on LLM-based tools in this contribution?

Not at all

How was the solution tested?

New automated tests (including the issue's reproducer, if applicable)

local1 => val local inObj: Obj[In] & Repr[In]
local2 => val local outObj: Obj[Out] & Repr[Out]
local1 => val local inObj: Obj[In]
local2 => val local outObj: Obj[Out]
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the source is case (inObj: Obj[In], outObj: Obj[Out]) so this makes sense to me

val newSelArgs = unadaptedArgs.zip(selArgs).map:
case (Typed(_, tpt: AppliedTypeTree), t) =>
// However, we can't do that if the args changed, e.g., if the args were patterns
typed(tpt) match
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compared to take 1, we at least use the result of this, and no longer need to check hasType

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@unchecked tuple destructuring is now ignored

2 participants